// -----------------------------------------------------------------------
//  <copyright file="RoleBase.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2025 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2025/1/4 20:11</last-date>
// -----------------------------------------------------------------------

using System.ComponentModel.DataAnnotations;


namespace DaprPlus.Identity.Domain.Entities;

public abstract class RoleBase : HasBothEventEntityBase, IRole, ISoftDeletable, ICreationTime
{
    /// <summary>
    /// Gets or sets the name for this role.
    /// </summary>
    public string Name { get; set; } = null!;

    /// <summary>
    /// Gets or sets the normalized name for this role.
    /// </summary>
    public virtual string NormalizedName { get; set; } = null!;

    /// <summary>
    /// 获取或设置 备注
    /// </summary>
    [StringLength(500)]
    public string? Remark { get; set; }

    /// <summary>
    /// A random value that should change whenever a role is persisted to the store
    /// </summary>
    public virtual string? ConcurrencyStamp { get; set; }

    public bool IsSystem { get; set; }

    public bool IsAdmin { get; set; }

    public bool IsDefault { get; set; }

    /// <summary>
    /// 是否锁定当前信息
    /// </summary>
    public bool IsLocked { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime CreatedTime { get; set; }

    /// <summary>
    /// 获取或设置 数据逻辑删除的时间，作为逻辑删除的标记，默认值为DateTime.MinValue，表示未删除，当值大于DateTime.MinValue时表示已删除
    /// </summary>
    public DateTime DeletedTime { get; set; }

    /// <summary>
    /// Returns the name of the role.
    /// </summary>
    /// <returns>The name of the role.</returns>
    public override string ToString()
    {
        return Name ?? string.Empty;
    }
}
